package com.gzcc.controller;

import com.gzcc.model.OrderInfo;
import com.gzcc.repository.OrderRespository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @author: Mr.Zhong
 * @create: 2018-06-24 14:22
 * @description: 订单controller
 **/
@Controller
@RequestMapping("/order")
public class OrderController {


    @Autowired
    private OrderRespository orderRespository;

    @RequestMapping()
    public ModelAndView index(){
        List<OrderInfo> data=orderRespository.findAll();
        ModelAndView modelAndView=new ModelAndView();
        modelAndView.addObject("list",data);
        modelAndView.setViewName("backend/order/order_list.btl");
        return modelAndView;
    }



}
